package com.woniuxy.yygh.msm.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO: oss 的读取配置类
 * <P> Date: 2022/3/3:20:32
 * <P> Description:
 */
@Component
public class ConstantOssPropertiesUtils implements InitializingBean {
    @Value("${aliyun.oss.endpointMy}")
    private String endpoint;

    @Value("${aliyun.oss.accessKeyIdMy}")
    private String accessKeyId;

    @Value("${aliyun.oss.secretMy}")
    private String secret;

    @Value("${aliyun.oss.bucketMy}")
    private String bucket;


    public static String ENDPOINT;
    public static String ACCESS_KEY_ID;
    public static String SECRECT;
    public static String BUCKET;

    /**
        * TODO: 获得key然后注入到final中
    **/
    @Override
    public void afterPropertiesSet() throws Exception {
        ENDPOINT = endpoint;
        ACCESS_KEY_ID = accessKeyId;
        SECRECT = secret;
        BUCKET = bucket;
    }
}
